package queryfish.db.db4o;

import java.util.ArrayList;
import java.util.StringTokenizer;

import javax.swing.JOptionPane;

import queryfish.antlr.parser.analysisQues;

public class Answer {
	public static String answer = "";
	public static String ansScience_name = "";
	public static String ansFish_set = "";
	public static String ansFish_class = "";
	public static String ansKind_of_fish = "";
	public static String ansSame_name = "";
	public static String ansEnglish_name = "";
	public static String ansVietnamese_name = "";
	public static String ansOriginal = "";
	public static String ansDistribution = "";
	public static String ansFish_long = "";
	public static String ansWater_tem = "";
	public static String ansDh = "";
	public static String ansPh = "";
	public static String ansFeeding = "";
	public static String ansReproduction = "";
	public static String ansWater_field = "";
	public static String ansAquarium = "";
	public static String ansFeed_form = "";
	public static String ansMoss_request = "";
	public static String ansLight_request = "";
	public static String ansWater_request = "";
	public static String ansAeration_request = "";
	public static String ansKind_of_food = "";
	public static String ansCaring = "";

	public static void getAnswer() {
		// xay dựng câu trả lời dựa trên kết quả của hàm truy vấn
		// hàm truy vấn trả về các araylist<String> , là các chuỗi thông tin cần
		// thiết
		// mỗi loại truy vấn sẽ có cấu trúc chuỗi khác nhau
		try {
			// kiểm tra tên cá có chính xác hay có tồn tại hay không ?

			if (Query.arrResult.get(0).equals("false")) {
				answer = "Câu hỏi sai hoặc không có dữ liệu về loại cá này !";
			}
			// show all info

			if (Query.arrResult.get(0).equals("")) {
//				System.out.print("in here\n");
				ArrayList<String> arrInfo = new ArrayList<String>();
				ArrayList<String> arrBio = new ArrayList<String>();
				ArrayList<String> arrTech = new ArrayList<String>();
				// bio
//				System.out.print(Query.arrResult.get(3)+"\n");
				StringTokenizer tokenBio = new StringTokenizer(
						Query.arrResult.get(3), "/");
				while (tokenBio.hasMoreTokens()) {
					arrBio.add(tokenBio.nextToken());
				}
				ansDistribution = "Phân bố :" + arrBio.get(0).toString();
				ansFish_long = "Chiều dài cá :" + arrBio.get(1).toString();
				ansWater_tem = "Nhiệt độ nước :" + arrBio.get(2).toString();
				ansDh = "Độ Dh :" + arrBio.get(3).toString();
				ansPh = "Độ Ph :" + arrBio.get(4).toString();
				ansFeeding = "Tính ăn :" + arrBio.get(5).toString();
				ansReproduction = "Sinh sản :" + arrBio.get(6).toString();
				ansWater_field = "Tầng nước sống :" + arrBio.get(7).toString();
//				System.out.print(ansDistribution+"\n");
				// info
//				System.out.print(Query.arrResult.get(4)+"infor \n");
				StringTokenizer tokenInfo = new StringTokenizer(
						Query.arrResult.get(4), "/");
				while (tokenInfo.hasMoreTokens()) {
					arrInfo.add(tokenInfo.nextToken());

				}
				ansScience_name = "Tên khoa học :" + arrInfo.get(0).toString();
				ansFish_set = "Thuộc bộ :" + arrInfo.get(1).toString();
				ansFish_class = "Thuộc họ :" + arrInfo.get(2).toString();
				ansKind_of_fish = "Thuộc loài :" + arrInfo.get(3).toString();
				ansSame_name = "Tên đồng danh :" + arrInfo.get(4).toString();
				ansEnglish_name = "Tên tiếng anh :" + arrInfo.get(5).toString();
				ansVietnamese_name = "Tên tiếng việt :"
						+ arrInfo.get(6).toString();
				ansOriginal = "Nguồn gốc :" + arrInfo.get(7).toString();
//				System.out.print(ansOriginal);

				// // // tech
//				System.out.print(Query.arrResult.get(5)+" \n");
				StringTokenizer tokenTech = new StringTokenizer(
						Query.arrResult.get(5), "/");
				while (tokenTech.hasMoreTokens()) {
					arrTech.add(tokenTech.nextToken());
				}
				ansAquarium = "Bể nuôi :" + arrTech.get(0).toString();
				ansFeed_form = "Hình thức nuôi :" + arrTech.get(1).toString();
				ansMoss_request = "Yêu cầu hồ rong :"
						+ arrTech.get(2).toString();
				ansLight_request = "Yêu cầu ánh sáng :"
						+ arrTech.get(3).toString();
				ansWater_request = "Yêu cầu lọc nước :"
						+ arrTech.get(4).toString();
				ansAeration_request = "Yêu cầu sục khí :"
						+ arrTech.get(5).toString();
				ansKind_of_food = "Loại thức ăn :" + arrTech.get(6).toString();
				ansCaring = "Chăm sóc :" + arrTech.get(7).toString();
//				System.out.print(ansCaring+"\n");
				// set answer
//				String str = analysisQues.nameFish.toString();
//				System.out.print(str);
				answer = "Cá " + analysisQues.nameFish + Connection.many + "\n"
						+ "*****" + "\n" + "Thông tin chung :" + "\n"
						+ ansScience_name + "\n" + ansFish_set + "\n"
						+ ansFish_class + "\n" + ansKind_of_fish + "\n"
						+ ansSame_name + "\n" + ansEnglish_name + "\n"
						+ ansVietnamese_name + "\n" + "Đặc điểm sinh học :"
						+ "\n" + ansDistribution + "\n" + ansFish_long + "\n"
						+ ansWater_tem + "\n" + ansDh + "\n" + ansPh + "\n"
						+ ansFeeding + "\n" + ansReproduction + "\n"
						+ ansWater_field + "\n" + "Kỹ thuật nuôi :" + "\n"
						+ ansAquarium + "\n" + ansFeed_form + "\n"
						+ ansMoss_request + "\n" + ansLight_request + "\n"
						+ ansWater_request + "\n" + ansAeration_request + "\n"
						+ ansKind_of_food + "\n" + ansCaring + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;
//				System.out.print(answer);

			}
			// start
			// answer for general information
			if (Query.arrResult.get(0).equals("generalInfo")) {

				ansScience_name = "Tên khoa học :"
						+ Query.arrResult.get(2).toString();
				ansFish_set = "Thuộc bộ :" + Query.arrResult.get(3).toString();
				ansFish_class = "Thuộc loài :"
						+ Query.arrResult.get(4).toString();
				ansKind_of_fish = "Thuộc loài :"
						+ Query.arrResult.get(5).toString();
				ansSame_name = "Tên đồng danh :"
						+ Query.arrResult.get(6).toString();
				ansEnglish_name = "Tên tiếng anh :"
						+ Query.arrResult.get(7).toString();
				ansVietnamese_name = "Tên tiếng việt :"
						+ Query.arrResult.get(8).toString();
				ansOriginal = "Nguồn gốc" + Query.arrResult.get(9).toString();
				ansDistribution = "Phân bố :"
						+ Query.arrResult.get(1).toString();
				// answer
				answer = "Cá " + analysisQues.nameFish + Connection.many + "\n"
						+ "*****" + "\n" + "Thông tin chung :" + "\n"
						+ ansScience_name + "\n" + ansFish_set + "\n"
						+ ansFish_class + "\n" + ansKind_of_fish + "\n"
						+ ansSame_name + "\n" + ansEnglish_name + "\n"
						+ ansVietnamese_name + "\n" + ansOriginal + "\n"
						+ ansDistribution + "\n\n\n" + Connection.desLink
						+ "\n" + Connection.strTitle1 + "\n"
						+ Connection.strURL1 + "\n" + Connection.strTitle2
						+ "\n" + Connection.strURL2 + "\n"
						+ Connection.strTitle3 + "\n" + Connection.strURL3
						+ "\n" + Connection.strTitle4 + "\n"
						+ Connection.strURL4;
			}
			// end
			// start
			//câu trả lời cho tên khóa học của cá
			if (Query.arrResult.get(0).equals("scienceName")) {
				ansScience_name = " " + Query.arrResult.get(1).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " có tên khoa học là :" + ansScience_name;

			}
			// end
			// start
			//tên thường gặp hoặc tên tiếng việt (tiếng việt)
			if (Query.arrResult.get(0).equals("commonName")
					|| Query.arrResult.get(0).equals("vnName")) {

				ansVietnamese_name = " " + Query.arrResult.get(1).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " có tên tiếng việt/tên phổ biến khác là :"
						+ ansVietnamese_name + "\n\n\n" + Connection.desLink
						+ "\n" + Connection.strTitle1 + "\n"
						+ Connection.strURL1 + "\n" + Connection.strTitle2
						+ "\n" + Connection.strURL2 + "\n"
						+ Connection.strTitle3 + "\n" + Connection.strURL3
						+ "\n" + Connection.strTitle4 + "\n"
						+ Connection.strURL4;
			}
			// end
			// start
			//bộ cá
			if (Query.arrResult.get(0).equals("fishSet")) {
				ansFish_set = " " + Query.arrResult.get(1).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " thuộc bộ cá :" + ansFish_set + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;

			}
			// end
			// start
			//họ cá
			if (Query.arrResult.get(0).equals("fishClass")) {
				ansFish_class = " " + Query.arrResult.get(1).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " thuộc họ cá :" + ansFish_class + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;

			}
			// end
			// start
			//loại cá
			if (Query.arrResult.get(0).equals("kindOfFish")) {
				ansKind_of_fish = " " + Query.arrResult.get(1).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " thuộc loài :" + ansKind_of_fish + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;

			}
			// end
			// start
			//tên đồng danh (tiếng anh)
			if (Query.arrResult.get(0).equals("sameName")) {
				ansSame_name = " " + Query.arrResult.get(1).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " có tên đồng danh là :" + ansSame_name + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;

			}
			// end
			// start
			//tên tiếng anh
			if (Query.arrResult.get(0).equals("engName")) {
				ansEnglish_name = " " + Query.arrResult.get(1).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " có tên tiếng anh là :" + ansEnglish_name + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;

			}
			// end
			// start
			//nguồn gốc
			if (Query.arrResult.get(0).equals("orgination")
					|| Query.arrResult.get(0).equals("distribution")) {
				ansOriginal = " " + Query.arrResult.get(2).toString();
				ansDistribution = " " + Query.arrResult.get(1).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ "\nCó nguồn gốc :\n" + ansOriginal + "\n"
						+ "Phân bố chủ yếu :\n" + ansDistribution + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;

			}
			// end
			// start
			//đặc tính sinh học
			if (Query.arrResult.get(0).equals("biology")) {
				ansDistribution = "Phân bố :"
						+ Query.arrResult.get(1).toString();
				ansFish_long = "Chiều dài cá :"
						+ Query.arrResult.get(2).toString();
				ansWater_tem = "Nhiệt độ nước :"
						+ Query.arrResult.get(3).toString();
				ansDh = "Độ Dh :" + Query.arrResult.get(4).toString();
				ansPh = "Độ Ph :" + Query.arrResult.get(5).toString();
				ansFeeding = "Tính ăn :" + Query.arrResult.get(6).toString();
				ansReproduction = "Đặc tính sinh sản :"
						+ Query.arrResult.get(7).toString();
				ansWater_field = "Tầng nước sống :"
						+ Query.arrResult.get(8).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " có đặc điểm sinh học :" + "\n" + ansDistribution
						+ "\n" + ansFish_long + "\n" + ansWater_tem + "\n"
						+ ansDh + "\n" + ansPh + "\n" + ansFeeding + "\n"
						+ ansReproduction + "\n" + ansWater_field + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;

			}
			// end
			// start
			//chiều dài cá
			if (Query.arrResult.get(0).equals("longFish")) {
				ansFish_long = " " + Query.arrResult.get(1).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " có chiều dài(cm) :" + ansFish_long + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;

			}
			// end
			// start
			//nhiệt độ nước
			if (Query.arrResult.get(0).equals("waterTemparature")) {
				ansWater_tem = " " + Query.arrResult.get(1).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " sống trong nước có nhiệt độ(C) :" + ansWater_tem
						+ "\n\n\n" + Connection.desLink + "\n"
						+ Connection.strTitle1 + "\n" + Connection.strURL1
						+ "\n" + Connection.strTitle2 + "\n"
						+ Connection.strURL2 + "\n" + Connection.strTitle3
						+ "\n" + Connection.strURL3 + "\n"
						+ Connection.strTitle4 + "\n" + Connection.strURL4;

			}
			// end
			// start
			//độ DH
			if (Query.arrResult.get(0).equals("dH")) {
				ansDh = " " + Query.arrResult.get(1).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " sống trong nước có độ cứng(Dh) :" + ansDh
						+ "\n\n\n" + Connection.desLink + "\n"
						+ Connection.strTitle1 + "\n" + Connection.strURL1
						+ "\n" + Connection.strTitle2 + "\n"
						+ Connection.strURL2 + "\n" + Connection.strTitle3
						+ "\n" + Connection.strURL3 + "\n"
						+ Connection.strTitle4 + "\n" + Connection.strURL4;

			}
			// end
			// start
			//độ pH
			if (Query.arrResult.get(0).equals("pH")) {
				ansPh = " " + Query.arrResult.get(1).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " sống trong nước có độ pH :" + ansPh + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;

			}
			// end
			// start
			//đặc tính sinh sản
			if (Query.arrResult.get(0).equals("repronduction")) {
				ansReproduction = " " + Query.arrResult.get(1).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " có đặc tính sinh sản :\n" + ansReproduction
						+ "\n\n\n" + Connection.desLink + "\n"
						+ Connection.strTitle1 + "\n" + Connection.strURL1
						+ "\n" + Connection.strTitle2 + "\n"
						+ Connection.strURL2 + "\n" + Connection.strTitle3
						+ "\n" + Connection.strURL3 + "\n"
						+ Connection.strTitle4 + "\n" + Connection.strURL4;

			}
			// end
			// start
			//tầng nước sống
			if (Query.arrResult.get(0).equals("waterField")) {
				ansWater_field = " " + Query.arrResult.get(1).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " có tầng nước sống(tầng mặt, giữa, đáy) :"
						+ ansWater_field + "\n\n\n" + Connection.desLink + "\n"
						+ Connection.strTitle1 + "\n" + Connection.strURL1
						+ "\n" + Connection.strTitle2 + "\n"
						+ Connection.strURL2 + "\n" + Connection.strTitle3
						+ "\n" + Connection.strURL3 + "\n"
						+ Connection.strTitle4 + "\n" + Connection.strURL4;

			}
			// end
			// start
			//kỹ thuật nuôi
			if (Query.arrResult.get(0).equals("cultureTech")) {
				ansFeeding = "Cá " + Query.arrResult.get(1).toString();
				ansAquarium = "Bể nuôi :" + Query.arrResult.get(2).toString();
				ansFeed_form = "Hình thức nuôi :"
						+ Query.arrResult.get(3).toString();
				ansMoss_request = "Yêu cầu hồ rong :"
						+ Query.arrResult.get(4).toString();
				ansLight_request = "Yêu cầu ánh sáng :"
						+ Query.arrResult.get(5).toString();
				ansWater_request = "Yêu cầu lọc nước :"
						+ Query.arrResult.get(6).toString();
				ansAeration_request = "Yêu cầu sục khí :"
						+ Query.arrResult.get(7).toString();
				ansKind_of_food = "Loại thức ăn :" + ansFeeding + " ,"
						+ Query.arrResult.get(8).toString();
				answer = "Kỹ thuật nuôi cá " + analysisQues.nameFish
						+ Connection.many + " :\n" + ansAquarium + "\n"
						+ ansAeration_request + "\n" + ansFeed_form + "\n"
						+ ansMoss_request + "\n" + ansLight_request + "\n"
						+ ansWater_request + "\n" + ansAeration_request + "\n"
						+ ansKind_of_food + "\n" + ansCaring + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;

			}
			// end
			// start
			//bể nuôi
			if (Query.arrResult.get(0).equals("designAquarium")) {
				ansAquarium = " " + Query.arrResult.get(1).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " được nuôi trong bể :\n" + ansAquarium + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;

			}
			// end
			// start
			//yêu cầu hồ rong
			if (Query.arrResult.get(0).equals("mossRequest")) {
				ansMoss_request = " " + Query.arrResult.get(1).toString();
				answer = "Yêu cầu hồ rong của cá " + analysisQues.nameFish
						+ Connection.many + " :" + ansMoss_request + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;

			}
			// end
			// start
			//yêu cầu ánh sáng
			if (Query.arrResult.get(0).equals("lightRequest")) {
				ansLight_request = " " + Query.arrResult.get(1).toString();
				answer = "Yêu cầu ánh sáng của cá " + analysisQues.nameFish
						+ Connection.many + " :" + ansLight_request + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;

			}
			// end
			// start
			//yêu cầu lọc nước
			if (Query.arrResult.get(0).equals("waterFilterRequest")) {
				ansWater_request = " " + Query.arrResult.get(1).toString();
				answer = "Yêu cầu lọc nước của cá " + analysisQues.nameFish
						+ Connection.many + " :" + ansWater_request + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;

			}
			// end
			// start
			//yêu cầu sục khí
			if (Query.arrResult.get(0).equals("aerationRequest")) {
				ansAeration_request = " " + Query.arrResult.get(1).toString();
				answer = "Yêu cầu sục khí của cá " + analysisQues.nameFish
						+ Connection.many + " :" + ansAeration_request
						+ "\n\n\n" + Connection.desLink + "\n"
						+ Connection.strTitle1 + "\n" + Connection.strURL1
						+ "\n" + Connection.strTitle2 + "\n"
						+ Connection.strURL2 + "\n" + Connection.strTitle3
						+ "\n" + Connection.strURL3 + "\n"
						+ Connection.strTitle4 + "\n" + Connection.strURL4;

			}
			// end
			// start
			//loại thức ăn
			if (Query.arrResult.get(0).equals("kindOfFood")) {
				ansFeeding = " " + Query.arrResult.get(1).toString();
				ansKind_of_food = " " + Query.arrResult.get(2).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ ansFeeding + "\nThức ăn là :" + ansKind_of_food
						+ "\n\n\n" + Connection.desLink + "\n"
						+ Connection.strTitle1 + "\n" + Connection.strURL1
						+ "\n" + Connection.strTitle2 + "\n"
						+ Connection.strURL2 + "\n" + Connection.strTitle3
						+ "\n" + Connection.strURL3 + "\n"
						+ Connection.strTitle4 + "\n" + Connection.strURL4;

			}
			// end
			// start
			//chăm sóc
			if (Query.arrResult.get(0).equals("caring")) {
				ansFeed_form = " " + Query.arrResult.get(1).toString();
				ansCaring = " " + Query.arrResult.get(2).toString();
				answer = "Cá " + analysisQues.nameFish + Connection.many
						+ " có :" + "\nHình thức nuôi :" + ansFeed_form
						+ "\nĐược chăm sóc :" + ansCaring + "\n\n\n"
						+ Connection.desLink + "\n" + Connection.strTitle1
						+ "\n" + Connection.strURL1 + "\n"
						+ Connection.strTitle2 + "\n" + Connection.strURL2
						+ "\n" + Connection.strTitle3 + "\n"
						+ Connection.strURL3 + "\n" + Connection.strTitle4
						+ "\n" + Connection.strURL4;

			}
			// end

		} catch (Exception e) {
			JOptionPane.showMessageDialog(null, "Không Thể Kết Xuất Trả Lời !",
					"Error", JOptionPane.ERROR_MESSAGE);
		}
	}
}
